package com.roundarch.flex.controls.dateSliderClasses
{
    import com.roundarch.flex.controls.graphControlInterfaces.IInterval;
    import com.roundarch.flex.controls.graphControlInterfaces.IIntervalToStringGenerator;

    /**
     *
     * @author Josh
     */
    public class DateSliderMonthStringGenerator implements IIntervalToStringGenerator
    {
        //---------------------------------------------------------------------
        //
        //  Static Variables
        //
        //---------------------------------------------------------------------
        private static var monthStrings : Array = ["JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"];

        //---------------------------------------------------------------------
        //
        //  Constructor
        //
        //---------------------------------------------------------------------
        /**
         *  Constructor
         */
        public function DateSliderMonthStringGenerator()
        {
        }

        //---------------------------------------------------------------------
        //
        //  Methods
        //
        //---------------------------------------------------------------------
        public function intervalToString(interval : IInterval, maxLength : int = -1) : String
        {
            var d : Date = new Date(interval.start);

            return monthStrings[d.month];
        }
    }
}
